//
//  SWTitleButton.swift
//  SinaWeibo
//
//  Created by wszyxc on 16/7/20.
//  Copyright © 2016年 wszyxc. All rights reserved.
//

import UIKit

class SWTitleButton: UIButton {
    
  //调整button中的文字和图片的位置
    
    override func layoutSubviews() {
        super.layoutSubviews()
        
        //重新布局
        
        let arrowW = imageView?.frame.width
//        let labelW = titleLabel?.frame.width
        
//        imageView?.frame.offsetInPlace(dx: labelW!, dy: 0)
//        
//        titleLabel?.frame.offsetInPlace(dx: -arrowW!, dy: 0)
        
        imageView?.frame.origin.x = frame.size.width - arrowW!
        
        titleLabel?.frame.origin.x = 0
        
    
        
    }
    
    

}
